1 <?php
2 include(
"header.php");
3 include(
"sidebar.php");
4 include(
"dbconnection.php");
5 ?>
6 <script type=
"text/javascript">
7 function Disable()
8 {

9 var
vstatus=document.getElementById("vehstatus");
10 var
x=document.getElementById("vehcost");
11 var
z=document.getElementById("vehstatus2");
12 var
pa=document.getElementById("particulars");
13 if
(vstatus.value == "Completed")
14 {
15 x.disabled=
false
16 z.disabled =
false
17 pa.disabled =
false
18 }

19 if
(vstatus.value == "Cancelled")
20 {
21 x.disabled=
true
22 z.disabled =
true
23 pa.disabled =
true
24 }
25
26
27 }
28 </script>
29 <?php
30 $result= mysql_query(
"select * from service where serviecid='$_GET[vserviceid]'");
31 $row1 = mysql_fetch_array($result);
32 ?>
33         
34                             
35         <div id=
"main">
36             
37             <a name=
"TemplateInfo"></a>
38             <h1>Vehicle Service</h1>
39             <?php

40 if
($ctins == 1)
41 {
42     echo
"<center><b>Employees account created successfully...</b></center><br>";
43     echo
"<center><b><a href='emplogin.php'>Click here to Login.</a></b></center>";
44 }

45 else

46 {
47     ?>
48         <form id=
"form1" name="form1" method="post" action="viewservicebillingreport.php">
49         <input type=
"hidden" name="serviceid" value="<?php echo $row1[serviecid]; ?>"/>
50         <input type=
"hidden" name="customerid" value="<?php echo $row1[custid]; ?>"/>
51         
52           <table width=
"494" border="1">
53             <tr>
54               <th width=
"58" scope="col">Sevice ID</th>
55               <th width=
"100" scope="col">&nbsp;<?php echo $row1[serviecid]; ?> </th>
56             </tr>
57             <?php
58             $result1= mysql_query(
"select * from customer where custid='$row1[custid]'");
59 $arrrec1= mysql_fetch_array($result1);
60             ?>
61             <tr>
62               <th scope=
"col">Customer ID</th>
63               <th scope=
"col">&nbsp;<?php echo $arrrec1[custid]; ?> </th>
64             </tr>
65             <tr>
66               <th scope=
"col">Customer name</th>
67               <th scope=
"col">&nbsp;<?php echo $arrrec1[fname]. " ". $arrrec1[lname]; ?></th>
68             </tr>
69             <tr>
70               <th scope=
"col">Vehicle name</th>
71               <th scope=
"col">&nbsp;<?php echo $row1[vehiclename]; ?> </th>
72             </tr>
73             <tr>
74               <th scope=
"col">Vehicle No.</th>
75               <th scope=
"col">&nbsp;<?php echo $row1[vehicleno]; ?> </th>
76             </tr>
77             <tr>
78               <th scope=
"col">Date</th>
79               <th scope=
"col">&nbsp;<?php echo $row1["date"]; ?> </th>
80             </tr>
81             <tr>
82               <th scope=
"col">Address</th>
83               <th scope=
"col">&nbsp;<?php echo $row1[address]; ?> </th>
84             </tr>
85             <tr>
86               <th scope=
"col">City</th>
87               <th scope=
"col">&nbsp;<?php echo $row1[city]; ?> </th>
88             </tr>
89             <tr>
90               <th scope=
"col">Landmark</th>
91               <th scope=
"col">&nbsp;<?php echo $row1[landmark]; ?> </th>
92             </tr>
93             <tr>
94               <th scope=
"col">ZIP Code</th>
95               <th scope=
"col">&nbsp;<?php echo $row1[zipcode]; ?> </th>
96             </tr>
97             <tr>
98               <th scope=
"col">Status</th>
99               <th scope=
"col"><label for="vehstatus"></label>
100                 <
select name="vehstatus" id="vehstatus" onchange="Disable()">
101                   <option
value="Completed">Completed</option>
102                    <option
value="Cancelled">Cancelled</option>
103               </
select> &nbsp; </th>
104             </tr>
105           <?php
106           
while($arrrec= mysql_fetch_array($result))
107           {
108 $result1= mysql_query(
"select * from customer where custid='$arrrec[custid]'");
109 $arrrec1= mysql_fetch_array($result1);
110            echo
" <tr>
111               <td>&nbsp; $arrrec[serviecid]</td>"
;
112             echo
"<td>&nbsp; $arrrec1[fname] $arrrec1[lname]</td>
113               <td>&nbsp; $arrrec[vehiclename]</td>
114               <td>&nbsp; $arrrec[date]</td>
115               <td>&nbsp; $arrrec[address]
116                     <br>&nbsp; City: $arrrec[city]
117                     <br>&nbsp; landmark: $arrrec[landmark]
118                     <br>&nbsp; PIN: $arrrec[zipcode]</td>
119               <td>&nbsp; More | Billing</td>
120             </tr>"
;
121           }
122           ?>
123           </table>
124           <br />
125           <table width=
"494" border="1">
126             <tr>
127               <th width=
"237" height="36" scope="col">Particulars</th>
128               <th width=
"241" scope="col"><label for="particulars"></label>
129               <textarea name=
"particulars" id="particulars"></textarea> &nbsp;</th>
130             </tr>
131             <?php
132             $result1= mysql_query(
"select * from customer where custid='$row1[custid]'");
133 $arrrec1= mysql_fetch_array($result1);
134             ?>
135             <tr>
136               <th height=
"30" scope="col">Service Cost</th>
137               <th scope=
"col"><input name="vehcost" type="text" id="vehcost" value="" /> &nbsp;</th>
138             </tr>
139             <tr>
140               <th height=
"33" scope="col">Date</th>
141               <th scope=
"col"><input name="date" type="text" id="date" value="<?php echo date("Y-m-d"); ?>" /> &nbsp;</th>
142             </tr>
143             <tr>
144               <th height=
"37" scope="col">Paid status</th>
145               <th scope=
"col">&nbsp;
146                 <
select name="vehstatus2" id="vehstatus2" >
147                   <option
value="Pending">Pending</option>
148                   <option
value="Paid">Paid</option>
149               </
select></th>
150             </tr>
151             <tr>
152               <th height=
"23" scope="col">&nbsp;</th>
153               <th scope=
"col">&nbsp;</th>
154             </tr>
155             <tr>
156               <th height=
"37" colspan="2" scope="col"><input type="submit" name="btnpay" id="btnpay" value="Generate vehicle service bill" /></th>
157             </tr>
158             <?php
159           
while($arrrec= mysql_fetch_array($result))
160           {
161 $result1= mysql_query(
"select * from customer where custid='$arrrec[custid]'");
162 $arrrec1= mysql_fetch_array($result1);
163            echo
" <tr>
164               <td>&nbsp; $arrrec[serviecid]</td>"
;
165             echo
"<td>&nbsp; $arrrec1[fname] $arrrec1[lname]</td>
166               <td>&nbsp; $arrrec[vehiclename]</td>
167               <td>&nbsp; $arrrec[date]</td>
168               <td>&nbsp; $arrrec[address]
169                     <br>&nbsp; City: $arrrec[city]
170                     <br>&nbsp; landmark: $arrrec[landmark]
171                     <br>&nbsp; PIN: $arrrec[zipcode]</td>
172               <td>&nbsp; More | Billing</td>
173             </tr>"
;
174           }
175           ?>
176           </table>
177     
178         </form>
179     <?php
180     }
181     ?>
182             
183 <br />
184                                             
185         </div>
186         
187 <!-- wrap ends here -->
188 </div>
189         
190 <?php
191 include(
"footer.php");
192 ?>


Gõ tìm kiếm nhanh...